package com.globalresources.dao.hibernate;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.globalresources.dao.inface.IGroupsDao;
import com.globalresources.po.Groups;

public class GroupsDaoHibernate extends HibernateDaoSupport implements
		IGroupsDao {
	public List<Groups> findAll(String sql) {
		return getHibernateTemplate().find(sql);
	}

	public boolean saveGroups(Groups groups) {
		try {
			getHibernateTemplate().save(groups);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	public boolean saveOrUpdate(Groups groups) {
		try {
			getHibernateTemplate().saveOrUpdate(groups);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	public boolean deleteGroups(Groups groups) {
		try {
			getHibernateTemplate().delete(groups);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}

	}

}
